/*
 * @(#)Note.java	1.0 Apr 26, 2008
 *
 *	The MIT License
 *
 *	Copyright (c) 2008 Malachi de AElfweald <malachid@gmail.com>
 *
 *	Permission is hereby granted, free of charge, to any person obtaining a copy
 *	of this software and associated documentation files (the "Software"), to deal
 *	in the Software without restriction, including without limitation the rights
 *	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *	copies of the Software, and to permit persons to whom the Software is
 *	furnished to do so, subject to the following conditions:
 *
 *	The above copyright notice and this permission notice shall be included in
 *	all copies or substantial portions of the Software.
 *
 *	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 *	THE SOFTWARE.
 */
package org.eoti.sound;

public enum Note
{
	// frequencies from http://www.indiana.edu/~emusic/hertz.htm
	C0(			"C0",	12,		16.4		),
	CSharp0(	"C#0",	13,		17.3		),
	D0(			"D0",	14,		18.4		),
	DSharp0(	"D#0",	15,		19.4		),
	E0(			"E0",	16,		20.6		),
	F0(			"F0",	17,		21.8		),
	FSharp0(	"F#0",	18,		23.1		),
	G0(			"G0",	19,		24.5		),
	GSharp0(	"G#0",	20,		26.0		),

	A1(			"A1",	21, 	27.5		), // Low Piano A
	ASharp1(	"A#1",	22,		29.1		),
	B1(			"B1",	23,		30.9		),
	C1(			"C1",	24,		32.7		),
	CSharp1(	"C#1",	25,		34.6		),
	D1(			"D1",	26,		36.7		),
	DSharp1(	"D#1",	27,		38.9		),
	E1(			"E1",	28,		41.2		),
	F1(			"F1",	29,		43.7		),
	FSharp1(	"F#1",	30,		46.2		),
	G1(			"G1",	31,		49.0		),
	GSharp1(	"G#1",	32,		51.9		),

	A2(			"A2",	33,		55.0		),
	ASharp2(	"A#2",	34,		58.3		),
	B2(			"B2",	35,		61.7		),
	C2(			"C2",	36,		65.4		),
	CSharp2(	"C#2",	37,		69.3		),
	D2(			"D2",	38,		73.4		),
	DSharp2(	"D#2",	39,		77.8		),
	E2(			"E2",	40,		82.4		),
	F2(			"F2",	41,		87.3		),
	FSharp2(	"F#2",	42,		92.5		),
	G2(			"G2",	43,		98.0		),
	GSharp2(	"G#2",	44,		103.8		),

	A3(			"A3",	45,		110.0		),
	ASharp3(	"A#3",	46,		116.5		),
	B3(			"B3",	47,		123.5		),
	C3(			"C3",	48,		130.8		),
	CSharp3(	"C#3",	49,		138.6		),
	D3(			"D3",	50,		146.8		),
	DSharp3(	"D#3",	51,		155.6		),
	E3(			"E3",	52,		164.8		),
	F3(			"F3",	53,		174.6		),
	FSharp3(	"F#3",	54,		185.0		),
	G3(			"G3",	55,		196.0		),
	GSharp3(	"G#3",	56,		207.7		),

	A4(			"A4",	57,		220.0		),
	ASharp4(	"A#4",	58,		233.1		),
	B4(			"B4",	59,		246.9		),
	C4(			"C4",	60,		261.6		),	// Middle C
	CSharp4(	"C#4",	61,		277.2		),
	D4(			"D4",	62,		293.7		),
	DSharp4(	"D#4",	63,		311.1		),
	E4(			"E4",	64,		329.6		),
	F4(			"F4",	65,		349.2		),
	FSharp4(	"F#4",	66,		370.0		),
	G4(			"G4",	67,		392.0		),
	GSharp4(	"G#4",	68,		415.3		),

	A5(			"A5",	69,		440.0		),
	ASharp5(	"A#5",	70,		466.2		),
	B5(			"B5",	71,		493.9		),
	C5(			"C5",	72,		523.3		),
	CSharp5(	"C#5",	73,		554.4		),
	D5(			"D5",	74,		587.3		),
	DSharp5(	"D#5",	75,		622.3		),
	E5(			"E5",	76,		659.3		),
	F5(			"F5",	77,		698.5		),
	FSharp5(	"F#5",	78,		740.0		),
	G5(			"G5",	79,		784.0		),
	GSharp5(	"G#5",	80,		830.6		),

	A6(			"A6",	81,		880.0		),
	ASharp6(	"A#6",	82,		932.3		),
	B6(			"B6",	83,		987.8		),
	C6(			"C6",	84,		1046.5		),
	CSharp6(	"C#6",	85,		1108.7		),
	D6(			"D6",	86,		1174.7		),
	DSharp6(	"D#6",	87,		1244.5		),
	E6(			"E6",	88,		1318.5		),
	F6(			"F6",	89,		1396.9		),
	FSharp6(	"F#6",	90,		1480.0		),
	G6(			"G6",	91,		1568.0		),
	GSharp6(	"G#6",	92,		1661.2		),

	A7(			"A7",	93,		1760.0		),
	ASharp7(	"A#7",	94,		1864.7		),
	B7(			"B7",	95,		1975.5		),
	C7(			"C7",	96,		2093.0		),
	CSharp7(	"C#7",	97,		2217.5		),
	D7(			"D7",	98,		2349.5		),
	DSharp7(	"D#7",	99,		2489.0		),
	E7(			"E7",	100,	2637.0		),
	F7(			"F7",	101,	2793.8		),
	FSharp7(	"F#7",	102,	2960.0		),
	G7(			"G7",	103,	3136.0		),
	GSharp7(	"G#7",	104,	3322.4		),

	A8(			"A8",	105,	3520.0		),
	ASharp8(	"A#8",	106,	3729.3		),
	B8(			"B8",	107,	3951.1		),
	C8(			"C8",	108,	4186.0		),
	CSharp8(	"C#8",	109,	4434.9		),
	D8(			"D8",	110,	4698.0		),
	DSharp8(	"D#8",	111,	4978.0		),
	E8(			"E8",	112,	5274.0		),
	F8(			"F8",	113,	5587.7		),
	FSharp8(	"F#8",	114,	5919.9		),
	G8(			"G8",	115,	6271.9		),
	GSharp8(	"G#8",	116,	6644.9		),

	A9(			"A9",	117,	7040.0		),
	ASharp9(	"A#9",	118,	7458.6		),
	B9(			"B9",	119,	7902.1		),
	C9(			"C9",	120,	8372.0		),
	CSharp9(	"C#9",	121,	8869.8		),
	D9(			"D9",	122,	9397.3		),
	DSharp9(	"D#9",	123,	9956.1		),
	E9(			"E9",	124,	10548.1		),
	F9(			"F9",	125,	11175.3		),
	FSharp9(	"F#9",	126,	11839.8		),
	G9(			"G9",	127,	12543.9		),
	GSharp9(	"G#9",	128,	13289.8		),

	A10(		"A10",	129,	14080.0		),
	ASharp10(	"A#10",	130,	14917.2		),
	B10(		"B10",	131,	15804.3		),
	C10(		"C10",	132,	16744.0		),
	CSharp10(	"C#10",	133,	17739.7		),
	D10(		"D10",	134,	18794.5		),
	DSharp10(	"D#10",	135,	19912.1		),
	E10(		"E10",	136,	21096.2		),
	F10(		"F10",	137,	22350.6		),
	FSharp10(	"F#10",	138,	23679.6		),
	G10(		"G10",	139,	25087.7		),
	GSharp10(	"G#10",	140,	26579.5		),

	A11(		"A11",	141,	28160.0		),
	ASharp11(	"A#11",	142,	29834.5		),
	B11(		"B11",	143,	31608.5		),
	C11(		"C11",	144,	33488.1		),
	CSharp11(	"C#11",	145,	35479.4		),
	D11(		"D11",	146,	37589.1		),
	DSharp11(	"D#11",	147,	39824.3		),
	E11(		"E11",	148,	42192.3		),
	F11(		"F11",	149,	44701.2		),
	FSharp11(	"F#11",	150,	47359.3		),
	G11(		"G11",	151,	50175.4		),
	GSharp11(	"G#11",	152,	53159.0		),

	A12(		"A12",	153,	56320.0		),
	ASharp12(	"A#12",	154,	59669.0		),
	B12(		"B12",	155,	63217.1		);

	Note(String name, int midiNote, double hz)
	{
		this.name = name;
		this.midiNote = midiNote;
		this.hz = hz;
	}
	protected String name;
	protected int midiNote;
	protected double hz;
	public String getName(){return name;}
	public int getMidiNote(){return midiNote;}
	public double getHertz(){return hz;}
}
